package
{
	import flash.net.SharedObject;
	
	import org.flixel.*;
	
	public class LoseState extends FlxState
	{
		protected var musicOff:Boolean;
		

		protected var localInformation:SharedObject;
		protected var theCurrentLevel:int;
		protected var toContinue:FlxText;
		
		public function LoseState(level:int)
		{
			super();

			var loseScreen:Class;
			if (level > 30) {
				loseScreen = Res.LosePurpleMonsterScreen;
			} else if (level > 15) {
				loseScreen = Res.LoseScorpionScreen;
			} else {
				loseScreen = Res.LoseWolfScreen;
			}
			
			var background:FlxSprite = new FlxSprite(0, 0, loseScreen);			
			add(background);
			musicOff = true;
			
			theCurrentLevel = level;

			//localInformation.data["currentLevel"] = "" + theCurrentLevel;
		}
		
		public override function update():void { 
			super.update(); 
			if (FlxG.mouse.justPressed()) {
				FlxG.switchState(new GameState(theCurrentLevel));
			}
		}
	}
}